﻿using Moq;
using NUnit.Framework;

namespace Calculator.Tests
{
    [TestFixture]
    public class CalculatorReaderTests
    {
        [TestCase("456.123", 456.123f)]
        public void ReadNumber_ReadsNumberCorrectly(string inputStr, float expectedNumber)
        {
            var calculatorMock = new Mock<ICalculator>();
            calculatorMock.Setup(x => x.GetTextFromScreen()).Returns(inputStr);

            var calculatorReader = new CalculatorReader();
            var number = calculatorReader.ReadNumber(calculatorMock.Object);

            Assert.AreEqual(expectedNumber, number);
            calculatorMock.Verify(x => x.GetTextFromScreen());
        }
    }
}
